using System;
using System.Collections.Generic;
using System.Text;
using BusinessObjects.BO_Actions;
using Entity.StoreProcedure;
using BusinessObjects;
using System.Data;
namespace BusinessObjects.BO_GetObjects {
	public static class BO_portal_config {
		public static DataTable SelectAll(int status) {
			try {
				usp_portal_config_select_all entity = new usp_portal_config_select_all();
				entity.STATUS = status;
				return BO_Actions<usp_portal_config_select_all>.ExecuteAndReturnDataTable(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static DataTable SelectTop(int rows, int status) {
			try {
				usp_portal_config_select_top entity = new usp_portal_config_select_top();
				entity.NUMBERRECORD = rows;
				entity.STATUS = status;
				return BO_Actions<usp_portal_config_select_top>.ExecuteAndReturnDataTable(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static DataTable Search(int portal_id) {
			try {
				usp_portal_config_search entity = new usp_portal_config_search();
				entity.PORTAL_ID = portal_id;

				return BO_Actions<usp_portal_config_search>.ExecuteAndReturnDataTable(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static DataTable SelectWithPaged(int startIndex, int pageCount, int status) {
			try {
				usp_portal_config_select_paged entity = new usp_portal_config_select_paged ();
				entity.STARTINDEX = startIndex;
				entity.MAXRECORDS = pageCount;
				entity.STATUS = status;
				return BO_Actions<usp_portal_config_select_paged>.ExecuteAndReturnDataTable(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static string Insert( string full_name, string domain_name, string default_language, string meta_keywords, string meta_description, string meta_content_type, string page_title, bool page_auto_f5, int auto_f5_seconds, int theme_id, int max_size_of_file_uploaded, bool is_addthis_plugin, string favicon_img, bool is_show_cp_menu, int max_user_login_failure, DateTime created_date, string created_by, DateTime modify_date, string modify_by, bool status) {
			try {
				usp_portal_config_insert entity = new usp_portal_config_insert();
                entity.FULL_NAME = full_name;
                entity.DOMAIN_NAME = domain_name;
                entity.DEFAULT_LANGUAGE = default_language;
                entity.META_KEYWORDS = meta_keywords;
                entity.META_DESCRIPTION = meta_description;
                entity.META_CONTENT_TYPE = meta_content_type;
                entity.PAGE_TITLE = page_title;
                entity.PAGE_AUTO_F5 = page_auto_f5;
                entity.AUTO_F5_SECONDS = auto_f5_seconds;
                entity.THEME_ID = theme_id;
                entity.MAX_SIZE_OF_FILE_UPLOADED = max_size_of_file_uploaded;
                entity.IS_ADDTHIS_PLUGIN = is_addthis_plugin;
                entity.FAVICON_IMG = favicon_img;
                entity.IS_SHOW_CP_MENU = is_show_cp_menu;
                entity.MAX_USER_LOGIN_FAILURE = max_user_login_failure;
                entity.CREATED_DATE = created_date;
                entity.CREATED_BY = created_by;
                entity.MODIFY_DATE = modify_date;
                entity.MODIFY_BY = modify_by;
                entity.STATUS = status;

				return BO_Actions<usp_portal_config_insert>.ExecuteAndReturnStringValue(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static string Update( int portal_id, string full_name, string domain_name, string default_language, string meta_keywords, string meta_description, string meta_content_type, string page_title, bool page_auto_f5, int auto_f5_seconds, int theme_id, int max_size_of_file_uploaded, bool is_addthis_plugin, string favicon_img, bool is_show_cp_menu, int max_user_login_failure, DateTime created_date, string created_by, DateTime modify_date, string modify_by, bool status) {
			try {
				usp_portal_config_update entity = new usp_portal_config_update();
                entity.PORTAL_ID = portal_id;
                entity.FULL_NAME = full_name;
                entity.DOMAIN_NAME = domain_name;
                entity.DEFAULT_LANGUAGE = default_language;
                entity.META_KEYWORDS = meta_keywords;
                entity.META_DESCRIPTION = meta_description;
                entity.META_CONTENT_TYPE = meta_content_type;
                entity.PAGE_TITLE = page_title;
                entity.PAGE_AUTO_F5 = page_auto_f5;
                entity.AUTO_F5_SECONDS = auto_f5_seconds;
                entity.THEME_ID = theme_id;
                entity.MAX_SIZE_OF_FILE_UPLOADED = max_size_of_file_uploaded;
                entity.IS_ADDTHIS_PLUGIN = is_addthis_plugin;
                entity.FAVICON_IMG = favicon_img;
                entity.IS_SHOW_CP_MENU = is_show_cp_menu;
                entity.MAX_USER_LOGIN_FAILURE = max_user_login_failure;
                entity.CREATED_DATE = created_date;
                entity.CREATED_BY = created_by;
                entity.MODIFY_DATE = modify_date;
                entity.MODIFY_BY = modify_by;
                entity.STATUS = status;

				return BO_Actions<usp_portal_config_update>.ExecuteAndReturnStringValue(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static bool Delete(string ids, string spliter, int delete_type) {
			try {
				usp_portal_config_delete entity = new usp_portal_config_delete();
				entity.IDS = ids;
				entity.SPLITER = spliter;
				entity.DELETE_TYPE = delete_type;

				return BO_Actions<usp_portal_config_delete>.ExecuteAndReturnBooleanValue(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static bool Restore(int portal_id) {
			try {
				usp_portal_config_restore entity = new usp_portal_config_restore();
				entity.PORTAL_ID = portal_id;

				return BO_Actions<usp_portal_config_restore>.ExecuteAndReturnBooleanValue(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
	}
}

